/*
 * BinaryTree.h
 *
 *  Created on: Dec 5, 2011
 *      Author: sanglei
 */

#ifndef BINARYTREE_H_
#define BINARYTREE_H_

#ifndef elemType
typedef int elemType;
#endif

typedef struct BTreeNode* pBtreeNode;

struct BTreeNode {
	elemType value;
	pBtreeNode left;/*左孩子*/
	pBtreeNode right;/*右孩子*/
};

/* 函数声明 */
pBtreeNode init_tree();
pBtreeNode insert(pBtreeNode pNode,pBtreeNode node);
pBtreeNode create_tree();
void create(pBtreeNode *p);//另一种方法
void pre_tree(pBtreeNode node);//先序遍历
void pre_tree_n(pBtreeNode node);//非递归版
void mid_tree(pBtreeNode node);
void mid_tree_n(pBtreeNode node);


#endif /* BINARYTREE_H_ */
